#pragma once
#include <QString>
#include <filesystem>
#include "app.h"
#include "data_reader.h"
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>

class DataSqlite:public DataReader {
private:
	QSqlDatabase m_db;
	QSqlQuery* m_query;

public:
	DataSqlite();
	~DataSqlite();

	// Inherited via DataReader
	virtual void initialize(std::string db) override;

	virtual void listCollections(uint32_t userid, DataExchange::CollectionsResponse* d) override;
	virtual void listContracts(uint32_t userid, DataExchange::ContractsResponse* d) override;
	virtual void listFactors(uint32_t userid, DataExchange::FactorsResponse* d) override;
	virtual void listStrategies(uint32_t userid, DataExchange::StrategiesResponse* d) override;
	virtual void collectionDetail(uint32_t userid, uint32_t rowid, DataExchange::Collection* d) override;
};
